<%-- 
    Document   : usuarioControl
    Created on : 22/11/2009, 10:54:38
    Author     : Carvalho
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" import="Model.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Parametros</title>
    </head>
    <body>
        <%
            String teste = request.getParameter("op");
            Usuario usu = new Usuario();
            UsuarioDAO dao = new UsuarioDAO();

            usu.setNome(request.getParameter("nomeUsuario"));
            usu.setSexo(request.getParameter("sexoUsuario"));
            usu.setRg(request.getParameter("rgUsuario"));
            usu.setCpf(request.getParameter("cpfUsuario"));
            usu.setEstCivil(request.getParameter("estcivilUsuario"));
            usu.setEmail(request.getParameter("emailUsuario"));
            usu.setCEP(Integer.parseInt(request.getParameter("cepUsuario")));
            usu.setLogin(request.getParameter("dataNascUsuario"));
            usu.setLogin(request.getParameter("loginUsuario"));
            usu.setSenha(request.getParameter("senhaUsuario"));
            usu.setNivel(request.getParameter("nivelUsuario"));

            if (teste.equals("Incluir")){
                dao.inserir(usu);
            }else if (teste.equals("Alterar")){
                dao.alterar(usu);
            }else if (teste.equals("Excluir")){
                dao.excluir(usu);
            }
        %>
    </body>
</html>
